package test.base;

import org.springframework.context.support.GenericXmlApplicationContext;


import junit.framework.TestCase;

public class CtxTestCase extends TestCase{
	protected GenericXmlApplicationContext ctx = null;
	private static String CONFIG_PATH = "classpath:applicationContext-*.xml";
	@Override
	protected void setUp() throws Exception {
		super.setUp();
		ctx = new GenericXmlApplicationContext();
        ctx.load(CONFIG_PATH);
        ctx.refresh();
	}
	@Override
	protected void tearDown() throws Exception {
		super.tearDown();
		ctx.close();
	}
	public Object getBean(String beanId){
        return ctx.getBean(beanId);
	}
	public Object getBean(Class clzz){
        return ctx.getBean(clzz);
	}
	
}
